Rename QEMU device model log file from /tmp/qemu.log to
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sat, 10 Dec 2005 23:20:08 +0000 (00:20 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sat, 10 Dec 2005 23:20:08 +0000 (00:20 +0100)
/var/log/qemu-dm.<pid>.log.
Also redirect stderr to this log file.

Signed-off-by: Xin Li <xin.b.li@intel.com>
tools/ioemu/exec.c
tools/ioemu/vl.c

index 195c358296fc16ab66f64a83e41b1bc6b4cd96b0..8bd69764e64090db0ad7378381383a8728a7c3b3 100644 (file)
@@ -142,10 +142,9 @@ void cpu_set_log(int log_flags)
 #else
         setvbuf(logfile, NULL, _IOLBF, 0);
 #endif
-/*
-       stdout = logfile;
-       stderr = logfile;
-*/
+
+        stdout = logfile;
+        stderr = logfile;
     }
 }
 
index 09aeff1e0f39a5cf060716b4ba35cad5fcb4e00c..d0fa5c5d561b26ec3e9ac0cda6d00b45f4e2078c 100644 (file)
@@ -428,9 +428,9 @@ void hw_error(const char *fmt, ...)
     vfprintf(stderr, fmt, ap);
     fprintf(stderr, "\n");
     if (logfile) {
-       fprintf(logfile, "qemu: hardware error: ");
-       vfprintf(logfile, fmt, ap);
-       fprintf(logfile, "\n");
+        fprintf(logfile, "qemu: hardware error: ");
+        vfprintf(logfile, fmt, ap);
+        fprintf(logfile, "\n");
     }
     va_end(ap);
     abort();
@@ -526,8 +526,8 @@ int64_t cpu_get_real_ticks(void)
 
 #elif defined(__ia64__)
 #include "ia64_intrinsic.h"
-#define cpu_get_real_ticks()   \
-       __ia64_getreg(_IA64_REG_AR_ITC)
+#define cpu_get_real_ticks()    \
+    __ia64_getreg(_IA64_REG_AR_ITC)
 
 #else
 #error unsupported CPU
@@ -2645,6 +2645,7 @@ int main(int argc, char **argv)
     char monitor_device[128];
     char serial_devices[MAX_SERIAL_PORTS][128];
     int serial_device_index;
+    char qemu_dm_logfilename[64];
     const char *loadvm = NULL;
     unsigned long nr_pages, extra_pages, ram_pages, *page_array;
     extern void *shared_page;
@@ -2695,6 +2696,8 @@ int main(int argc, char **argv)
     macaddr[5] = 0x56;
 
     /* init debug */
+    sprintf(qemu_dm_logfilename, "/var/log/qemu-dm.%d.log", getpid());
+    cpu_set_log_filename(qemu_dm_logfilename);
     cpu_set_log(0);
 
     optind = 1;